﻿@model TestEmailIM

@using (Ajax.BeginForm("Test", "EmailAccount",
                                        new AjaxOptions()
                                        {
                                            HttpMethod = "POST",
                                            OnBegin = "onBegin",
                                            OnComplete = "onComplete",
                                            OnSuccess = "TestSuccess",
                                            //OnFailure = "handleError",
                                            //UpdateTargetId = "tr" + Model.Id

                                        }, new { @class = "form-horizontal", role = "form" }))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)
    @Html.HiddenFor(model => model.AccountId)


    <!-- 添加菜单 Modal -->
    <div class="modal fade" id="ModalEdit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">@string.Format("测试{0}", EntityNames.EmailAccount)</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        @Html.LabelFor(model => model.TestEmail, new { @class = "col-md-3 control-label" })
                        <div class="col-md-9">
                            @Html.TextBoxFor(model => model.TestEmail, new { @class = "form-control", placeholder = Labels.TestEmail })
                            @Html.ValidationMessageFor(model => model.TestEmail)
                        </div>
                    </div> 
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button class="btn btn-primary" type="submit" id="btnSave"><i class="fa fa-save fa-fw"></i>发送</button>
                </div>
            </div>
        </div>
    </div>
}

<script type="text/javascript" language=javascript>
    $.validator.unobtrusive.parse(document);
</script>